package com.lanyun.pojo;/**
 * @author zhy
 * @date 2021/1/5 - 19:13
 */


import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

/**

 @ClassName admin
 @Description xxx
 @Author zhy
 @Date 2021/1/5 - 19:13
 @Version 1.0
 **/
public class Admin {
    private Integer id;//------id

    @NotBlank(message = "登录名不能为空")
    @Length(min=2, max=10, message="登录名长度必须在2-10之间")
    private String loginName; //------登录名

    private String name; //-----用户名

    @Pattern(regexp = "^[0-9A-Za-z]{3,15}$",message = "密码由字母和数字组成，长度为3-15位")
    private String pwd; //------密码

    private String gender; //-----性别

    private String phone; //-----手机号码

    private Integer state;//----管理员状态

    private Role role; //-----该管理员与之对应的角色

    public Admin() {

    }

    public Admin(Integer id, String loginName, String name, String pwd, String gender, String phone,Integer state, Role role) {
        this.id = id;
        this.loginName = loginName;
        this.name = name;
        this.pwd = pwd;
        this.gender = gender;
        this.phone = phone;
        this.state = state;
        this.role = role;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public Role getRole() {
        return role;
    }

    public void setRole(Role role) {
        this.role = role;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", loginName='" + loginName + '\'' +
                ", name='" + name + '\'' +
                ", pwd='" + pwd + '\'' +
                ", gender='" + gender + '\'' +
                ", phone='" + phone + '\'' +
                ", state='" + state + '\'' +
                ", role=" + role +
                '}';
    }
}
